#include <cstdio>
#include <algorithm>
int n, m, l, x, y, z;
const int maxn = 1000000+7;
typedef long long ll;
long long a[maxn], b[maxn], c[maxn];


// #define int long long

inline bool Check(long long a[], ll n, ll f, double val) {
  double foo = 0;
  double ans = -1;
  static double buf[maxn];
  for (int i = 1; i <= n; ++i) {
    buf[i] = buf[i - 1] + a[i] - val;
  }
  for (int i = f; i <= n; ++i) {
    if (buf[i - f] < foo) foo = buf[i - f];
    if (buf[i] - foo > ans) ans = buf[i] - foo;
  }
  return ans >= 0;
}

double solve(long long a[], int n, int f)
{
  double l = a[1], r = a[1];
  for (int i = 1; i <= n; ++i) {
    if (a[i] < l)
      l = a[i];
    else if (a[i] > r)
      r = a[i];
  }
  while (r-l>1e-6) {
    double mid = (l + r)/2;
    if (Check(a, n, f, mid)) l = mid;
    else r = mid;
  }
  return l;
}

signed main() {
  int T; scanf("%d", &T);
  while(T--) {
    scanf("%d%d%d", &n, &m, &l);
    scanf("%d%d%d", &x, &y, &z);
    for(int i=1; i<=n; ++i) scanf("%lld", a+i);
    for(int i=1; i<=m; ++i) scanf("%lld", b+i);
    for(int i=1; i<=l; ++i) scanf("%lld", c+i);
    // printf("???\n");
    double ans = 0;
    ans += solve(a, n, x);
    ans += solve(b, m, y);
    ans += solve(c, l, z);
    // printf("%lld.%lld", ans/1000, ans%1000);
    printf("%.3lf\n", ans);
  }
}

